package com.easybbs.entity.enums;

/**
 * @Author: yudaxian
 * @Description: 发送验证码类型
 * @DateTime: 2024/10/18 10:22
 **/
public enum CheckCodeTypeEnum {
    LOGIN_REGISTER(0, "发送登录注册验证码"),
    EMAIL(1, "发送邮箱验证码")
    ;

    private Integer code;

    private String desc;

    public static CheckCodeTypeEnum getByCode(Integer code) {
        for (CheckCodeTypeEnum type : CheckCodeTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }

    CheckCodeTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

}
